"""CreateAdminConfigTable Migration."""

from masoniteorm.migrations import Migration


class CreateAdminConfigTable(Migration):
    def up(self):
        """
        Run the migrations.
        """
        with self.schema.create("admin_configs") as table:
            table.table_comment('后台配置')
            table.increments("id")
            table.string('title', 50, False).comment('配置名，英文')
            table.string('content', 100, True).comment('配置内容')
            table.string('remark', 100, True).comment("备注")

            table.unique('title', 'uni_title')

    def down(self):
        """
        Revert the migrations.
        """
        self.schema.drop("admin_configs")
